import request from '@/utils/request'
import { transFormValue, transformData } from '@/utils/tools'

//字段列表
export function fieldGetList(data) {
  return request({
    url: '/field/getList' + transFormValue(data),
    method: 'post'
  })
}

//创建字段
export function fieldCreate(data) {
    return request({
      url: '/field/create',
      method: 'post',
      data: transformData(data)
    })
}

//更新字段
export function fieldUpdate(data) {
    return request({
      url: '/field/update',
      method: 'post',
      data: transformData(data)
    })
}

//删除字段
export function fieldDelete(data) {
    return request({
      url: '/field/delete' + transFormValue(data),
      method: 'post'
    })
}


//获取模板字段路径
export function fieldGetFieldTemplatePath() {
    return request({
      url: '/field/getFieldTemplatePath',
      method: 'post'
    })
}

//异步刷新模板字段A
export function fieldAsyncRefreshTemplateFields(data) {
    return request({
      url: '/field/asyncRefreshTemplateFields' + transFormValue(data),
      method: 'post'
    })
}

